<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>商家资质</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
		<style>
			.empty{top: 40px;}
		</style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title">商家资质</span>
					</div>
					<div class="indrig_con">
						
					<!--选项卡内容开始-->
					<form id="my_form" action="{:url('oem/count/agent_bankinfo')}" method="post">
					<div class="zizh_con_1" style="margin-top: 10px;">
						<div class="chax_rowbox clearfix">
							<div class="shxx_row clearfix">
					            <div class="left">商家名称：</div>
					            <div class="right clearfix">
					                <input type="text" name="agent_name" id="agent_name" value="{$agent_name}" placeholder="商家名称" class="chax_input" />
					          	 </div>
					        </div>
				         	<div class="shxx_row chax_row clearfix">
					            <div class="left">手机号：</div>
					            <div class="right clearfix">
					                <input type="text" name="mobile" id="mobile" value="{$mobile}" placeholder="商家手机号" class="chax_input" />
				          	 	</div>
			      		  	</div>
						</div>
						<div class="chax_rowbox clearfix">
							<div class="shxx_row clearfix">
					            <div class="left">审核状态：</div>
					            <div class="right clearfix">
									<div id="htselect">
										<select name="state" style="width: 210px;height: 25px;">
											<option value="0">全部</option>										
											<option value="2">待审核</option>
											<option value="3">已驳回</option>
											<option value="4">已审核</option>
										</select>
									</div>
					            </div>
					        </div>
					         <div class="shxx_row chax_row clearfix">
					            <div class="left"></div>
					            <div class="right clearfix">
					                
					          	 </div>
				      		  </div>
					        <button type="submit" onclick="return check_time()" class="htcxbtn">搜索</button>
						</div>
						</form>

						<div class="help_lisbox">
							<table class="zizh_table1">
								<thead>
									<tr class="text-c" style="text-align: center;">
										<th>商户全称</th>
										<th style="width: 100px;">商户手机号</th>
										<th style="width: 100px;">状态</th>
										<th style="width: 120px;">增加时间</th>
										<th style="width: 120px;">操作</th>
									</tr>
								</thead>
								<tbody>
								{volist name="list" id="vo" empty="这里没有数据"}
								<tr class="text-c" style="text-align: center;">
									<td>
									{$vo.agent_name}
									</td>
									<td>{$vo.mobile}</td>
									<td>
										{if $vo.state==4}
										<span style="color: #5eb95e;">已审核</span>
										{elseif $vo.state==2 || $vo.state==0}
										<span style="color: red;">待审核</span>
										{elseif $vo.state==3}
										<span style="color: #00a1d6;">已驳回</span>
										{/if}
									</td>
									<td>{$vo.add_time}</td>
									<td class="td-manage">
										<a title="查看资料" href="{:url('index/qianyue_step',['agent_id'=>$vo.id])}"  class="ml-5" style="text-decoration:none">查看资料</a>
										{if $vo.state==2}
										<a title="驳回" href="javascript:;" onclick="agent_reject('{$vo.id}')" class="ml-5" style="text-decoration:none">驳回</a>
										<a title="通过" href="javascript:;" onclick="examine_pass(this,{$vo.id})"  class="ml-5" >通过</a>
										{/if}
									</td>
								</tr>
								{/volist}
								</tbody>
							</table>
							<div class="fenye" style="display: block;">
								{$list->render()}
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
	<script type="text/javascript">
			/*审核通过*/
			function examine_pass(obj, id) {
				layer.confirm('确认审核通过吗？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						type: 'get',
						url: "{:url('count/examine_pass')}",
						dataType: 'json',
						data: {
							id: id
						},
						success: function(data) {
							if(data.code == 200) {
								layer.msg(data.msg, {
								  icon: 1,
								  time: 1000 //2秒关闭（如果不配置，默认是3秒）
								}, function(){
									location.href = "{:url('count/agent_bankinfo')}";
								});
							} else {
								layer.msg(data.msg, {
									icon: 1,
									time: 1000
								});
							}
						},
						error: function(data) {
							console.log(data.msg);
						}
					});
				});
			}
			
		function agent_reject(id) {
			var url = 'agent_reject?id=' + id;
			layer.open({
				type: 2,
				title: '驳回原因',
				shadeClose: true,
				shade: 0.8,
				area: ['450px', '300px'],
				content: [url]
			});
		}
	</script>
